'use strict';
const express = require('express');
const router = express.Router();

// 下载APP页面
router.get('/', function (req, res) {
    let data = {};
    if (req.query.id == 'mjhz') {
        data.name = '盟友杭州麻将';
        data.icon = 'icon_mjhz.png';
        data.apk = 'downloads/mzh_mjhz.apk';
        data.ipa = 'itms-services://?action=download-manifest&url=' +
            'http://www.silinan.com:3000/downloads/mzh_mjhz.plist';
    } else if (req.query.id = 'mjjy') {
        data.name = '盟友缙云麻将';
        data.icon = 'icon_mjjy.png';
        data.apk = 'downloads/mzh_mjjy.apk';
        data.ipa = 'downloads/mzh_mjjy.ipa';
    }
    res.render('download_app', data);
});

module.exports = router;
